home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / midas060 / src / sdevice.inc < prev    next >
Encoding:
Text File  |  1997-01-16  |  9.2 KB  |  257 lines

  1. ;*      SDEVICE.INC
  2. ;*
  3. ;* Sound Device definitions
  4. ;*
  5. ;* $Id: sdevice.inc,v 1.4 1997/01/16 18:41:59 pekangas Exp $
  6. ;*
  7. ;* Copyright 1996,1997 Housemarque Inc.
  8. ;*
  9. ;* This file is part of the MIDAS Sound System, and may only be
  10. ;* used, modified and distributed under the terms of the MIDAS
  11. ;* Sound System license, LICENSE.TXT. By continuing to use,
  12. ;* modify or distribute this file you indicate that you have
  13. ;* read the license and understand and accept it fully.
  14. ;*
  15.  
  16.  
  17. IFDEF __16__
  18. SMPMAX = 65519                          ; max sample length (65536-16 - 1)
  19. ELSE
  20. SMPMAX = 4294967279                     ; max sample length (2^32 - 17)
  21. ENDIF
  22.  
  23. MAXSAMPLES = 256                        ; maximum number of samples
  24.  
  25.  
  26. ;/***************************************************************************\
  27. ;*      enum sdSampleType
  28. ;*      -----------------
  29. ;* Description: Sample types
  30. ;\***************************************************************************/
  31.  
  32. ENUM    sdSampleType \
  33.         smpNone = 0, \                  ; no sample
  34.         smp8bitMono = 1, \              ; 8-bit mono unsigned sample
  35.         smp8bit = smp8bitMono, \        ; for compatibility
  36.         smp16bitMono = 2, \             ; 16-bit mono signed sample
  37.         smp16bit = smp16bitMono, \      ; for compatibility
  38.         smp8bitStereo = 3, \            ; 8-bit stereo unsigned sample
  39.         smp16bitStereo = 4              ; 16-bit stereo signed sample
  40.  
  41.  
  42.  
  43.  
  44. ;/***************************************************************************\
  45. ;*      enum sdLoopMode
  46. ;*      ---------------
  47. ;* Description: Sample looping modes
  48. ;\***************************************************************************/
  49.  
  50. ENUM    sdLoopMode \
  51.         sdLoopNone = 0, \               ; no looping */
  52.         sdLoop1, \                      ; 1 loop, release ends note
  53.         sdLoop1Rel, \                   ; 1 loop, sample data after loop is
  54.         \                               ; played when note is released
  55.         sdLoop2, \                      ; 2 loops, when note is released
  56.         \                               ; playing is continued looping the
  57.         \                               ; second loop
  58.         sdLoopAmigaNone, \              ; Amiga compatible looping, no
  59.         \                               ; loop - ALE logic enabled anyway
  60.         sdLoopAmiga                     ; Amiga compatible looping - 1
  61.                                         ; loop, ALE logic enabled
  62.  
  63.  
  64.  
  65.  
  66. ;/***************************************************************************\
  67. ;*      enum sdLoopType
  68. ;*      ---------------
  69. ;* Description: Sample looping type for one loop
  70. ;\***************************************************************************/
  71.  
  72. ENUM    sdLoopType \
  73.         loopNone = 0, \                 ; no looping
  74.         loopUnidir, \                   ; unidirectional loop
  75.         loopBidir                       ; bidirectional loop
  76.  
  77.  
  78.  
  79.  
  80. ;/***************************************************************************\
  81. ;*      enum sdSmpPos
  82. ;*      -------------
  83. ;* Description: Sample positions in memory
  84. ;\***************************************************************************/
  85.  
  86. ENUM    sdSmpPos \
  87.         sdSmpNone = 0, \                ; no sample
  88.         sdSmpConv, \                    ; conventional memory
  89.         sdSmpEMS                        ; EMS
  90.  
  91.  
  92.  
  93.  
  94. ;/***************************************************************************\
  95. ;*      struct sdSample
  96. ;*      ---------------
  97. ;* Description: Sound Device sample information structure
  98. ;\***************************************************************************/
  99.  
  100. STRUC   sdSample
  101.  
  102. D_ptr   sample                          ; sample data pointer
  103. D_int   samplePos                       ; sample position in memory, see enum
  104.                                         ; sdSmpPos
  105. D_int   sampleType                      ; sample type, see enum sdSampleType
  106. D_int   sampleLength                    ; sample length
  107. D_int   loopMode                        ; sample looping mode, see enum
  108.                                         ; sdLoopMode
  109. D_int   loop1Start                      ; first loop start
  110. D_int   loop1End                        ; first loop end
  111. D_int   loop1Type                       ; first loop type, see enum sdLoopType
  112. D_int   loop2Start                      ; second loop start
  113. D_int   loop2End                        ; second loop end
  114. D_int   loop2Type                       ; second loop type, see enum
  115.  
  116. ENDS
  117.  
  118.  
  119.  
  120. ;/***************************************************************************\
  121. ;*      enum sdPanning
  122. ;*      --------------
  123. ;* Description: Sound Device panning values. Legal values range from
  124. ;*              panLeft to panRight, in steps of 1, plus panSurround.
  125. ;*              Surround sound is played from middle if surround is not
  126. ;*              enabled.
  127. ;\***************************************************************************/
  128.  
  129. ENUM    sdPanning \
  130.         panLeft = -64, \                ; left speaker
  131.         panMiddle = 0, \                ; middle (both speakers)
  132.         panRight = 64, \                ; right speaker
  133.         panSurround = 80h               ; surround sound
  134.  
  135.  
  136.  
  137.  
  138. ;/***************************************************************************\
  139. ;*      enum sdMode
  140. ;*      -----------
  141. ;* Description: Possible SoundDevice output modes
  142. ;\***************************************************************************/
  143.  
  144. ENUM    sdMode \
  145.         sdMono = 1, \                   ; mono
  146.         sdStereo = 2, \                 ; stereo
  147.         sd8bit = 4, \                   ; 8-bit output
  148.         sd16bit = 8                     ; 16-bit output
  149.  
  150.  
  151.  
  152.  
  153. ;/***************************************************************************\
  154. ;*      enum sdConfigBits
  155. ;*      -----------------
  156. ;* Description: Sound Device configuration information bits
  157. ;\***************************************************************************/
  158.  
  159. ENUM    sdConfigBits \
  160.         sdUsePort = 1, \                ; SD uses an I/O port
  161.         sdUseIRQ = 2, \                 ; SD uses an IRQ
  162.         sdUseDMA = 4, \                 ; SD uses a DMA channel
  163.         sdUseMixRate = 8, \             ; SD uses the set mixing rate
  164.         sdUseOutputMode = 16, \         ; SD uses the set output mode
  165.         sdUseDSM = 32                   ; SD uses software mixing (DSM)
  166.  
  167.  
  168.  
  169.  
  170. ;/***************************************************************************\
  171. ;*      struct SoundDevice
  172. ;*      ------------------
  173. ;* Description: SoundDevice structure. See SDEVICE.TXT for documentation
  174. ;\***************************************************************************/
  175.  
  176. STRUC   SoundDevice
  177.  
  178.         D_int   tempoPoll
  179.         D_int   configBits              ; Configuration info bits. See enum
  180.                                         ; sdConfigBits.
  181.         D_int   port                    ; Sound Device I/O port address
  182.         D_int   IRQ                     ; Sound Device IRQ number
  183.         D_int   DMA                     ; Sound Device DMA channel number
  184.         D_int   cardType                ; Sound Device sound card type.
  185.                                         ; Starting from 1, 0 means
  186.                                         ; autodetect
  187.         D_int   numCardTypes            ; number of different sound card
  188.                                         ; types for this Sound Device
  189.         D_int   modes                   ; Possible modes for this SD,
  190.                                         ; see enum sdMode. Updated by
  191.                                         ; Detect()
  192.         D_ptr   sdName                  ; pointer to Sound Device name string
  193.         D_ptr   cardNames               ; pointer to an array of pointers to
  194.                                         ; sound card name strings
  195.         D_int   numPortAddresses        ; number of possible port
  196.                                         ; addresses in table
  197.         D_ptr   portAddresses           ; pointer to an array of possible
  198.                                         ; I/O port addresses
  199.  
  200.         D_ptr   Detect
  201.         D_ptr   Init
  202.         D_ptr   Close
  203.         D_ptr   GetMixRate
  204.         D_ptr   GetMode
  205.         D_ptr   OpenChannels
  206.         D_ptr   CloseChannels
  207.         D_ptr   ClearChannels
  208.         D_ptr   Mute
  209.         D_ptr   Pause
  210.         D_ptr   SetMasterVolume
  211.         D_ptr   GetMasterVolume
  212.         D_ptr   SetAmplification
  213.         D_ptr   GetAmplification
  214.         D_ptr   PlaySound
  215.         D_ptr   ReleaseSound
  216.         D_ptr   StopSound
  217.         D_ptr   SetRate
  218.         D_ptr   GetRate
  219.         D_ptr   SetVolume
  220.         D_ptr   GetVolume
  221.         D_ptr   SetSample
  222.         D_ptr   GetSample
  223.         D_ptr   SetPosition
  224.         D_ptr   GetPosition
  225.         D_ptr   GetDirection
  226.         D_ptr   SetPanning
  227.         D_ptr   GetPanning
  228.         D_ptr   MuteChannel
  229.         D_ptr   AddSample
  230.         D_ptr   RemoveSample
  231.         D_ptr   SetUpdRate
  232.         D_ptr   StartPlay
  233.         D_ptr   Play
  234.  
  235. IFDEF SUPPORTSTREAMS
  236.         D_ptr   StartStream
  237.         D_ptr   StopStream
  238.         D_ptr   SetLoopCallback
  239.         D_ptr   SetStreamWritePosition
  240. ENDIF
  241.  
  242. ENDS
  243.  
  244.  
  245. ;* $Log: sdevice.inc,v $
  246. ;* Revision 1.4  1997/01/16 18:41:59  pekangas
  247. ;* Changed copyright messages to Housemarque
  248. ;*
  249. ;* Revision 1.3  1997/01/16 18:21:23  pekangas
  250. ;* Added function SetStreamWritePosition
  251. ;*
  252. ;* Revision 1.2  1996/05/28 20:29:07  pekangas
  253. ;* Added definitions for stereo sample types
  254. ;*
  255. ;* Revision 1.1  1996/05/22 20:49:33  pekangas
  256. ;* Initial revision
  257. ;*